/**
 * @file
 * @author  Tsin Smith <tsin.creator@gmail.com>
 *
 * @section DESCRIPTION
 *
 */

#ifndef __TSIN_LIBRARY_BULLETREFLECTEVENT_HPP__
#define __TSIN_LIBRARY_BULLETREFLECTEVENT_HPP__

#include <tsin/library/common.hpp>
#include <tsin/library/BulletEvent.hpp>

namespace tsin {

        const int REFLECT_LEFT = 1;
        const int REFLECT_RIGHT = REFLECT_LEFT << 1;
        const int REFLECT_TOP = REFLECT_RIGHT << 1;
        const int REFLECT_BOTTOM = REFLECT_TOP << 1;

        class LIBRARY_DLLEXPORT BulletReflectEvent : public BulletEvent {
        public:
                BulletReflectEvent(bool d = false);

                void init(int borders = REFLECT_LEFT | REFLECT_RIGHT | REFLECT_TOP, int times = 1);
                void reinit();

                virtual DynamicObject *copy();
                virtual bool trigger(BulletRuntime &bullet, void *data = 0);
                virtual BulletEvent *handle(BulletRuntime &bullet, void *data = 0);

        private:
                int times;
                int borders;
        };

}

extern "C" LIBRARY_DLLEXPORT tsin::DynamicObject *bindReflectEvent();

#endif /* __TSIN_LIBRARY_BULLETREFLECTEVENT_HPP__ */
